{include file="public/nheader" /}

<style type="text/css">
    #lay-tableList {
        height: auto;
    }
</style>
<style type="text/css">
    .layui-table-view .layui-table[lay-size=lg] .layui-table-cell {
        height: auto;
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 创建数据实例 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <!-- // 打开添加页面 -->
                        <button class="layui-btn icon-btn" lay-maxmin="true" lay-open="" data-title="添加计划"
                            data-area="60%,80%" data-url="/admin/copylist_edit">添加计划
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>
<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" lay-open data-title="编辑" data-area="60%,80%" data-url="/admin/copylist_edit?id={{d.id}}" >编辑</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="layui-table-text" lay-open data-title="复制计划" data-area="60%,80%" data-url="/admin/copylist_edit?id={{d.id}}&copy=1">复制计划</a>
</script>
{include file="public/nfooter"}
<script>
    layui.use(['table'], function () {
        var table = layui.table;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url()}"
            , page: true
            , size: 'lg'
            , even: true
            , cols: [[
                { field: 'id', align: 'center', width: 80, title: 'ID' },
                { field: 'name', align: 'center', width: 200, title: '配置名称' },
                { field: 'status_text', align: 'center', width: 200, title: '开关状态' },
                {
                    field: 'urlm', align: 'center', title: '导入配置', width: 250, templet: function (d) {
                        var html = '';
                        if (!d.pbpp_list) {
                            html += '<p>跑动品牌:无</p>';
                        } else {
                            html += '<p>跑动品牌:' + d.pbpp_list + '</p>';
                        }
                        if (!d.value.provincelist) {
                            html += '<p>跑动省份:全国</p>';
                        } else {
                            html += '<p>跑动省份:' + d.value.provincelist + '</p>';
                        }
                        html += '<p>日有效:' + d.value.youxiao + '条|日无效' + d.value.wuxiao + '条</p>';
                        html += '<p>导入日期:' + d.value.daterangestar + '-' + d.value.daterangeend + '</p>';
                        html += '<p>资源范围:' + d.value.datebefore + '-' + d.value.dateafter + '天前</p>';
                        return html;
                    }
                },
                { field: 'created', align: 'center', width: 200, title: '创建时间' },
                { align: 'center', toolbar: '#tableBar', width: 250, title: '操作' },
            ]]
        })
    })
</script>
</body>